package com.mframe.activiti.service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mframe.activiti.domain.Audit;
import com.mframe.activiti.mapper.AuditMapper;
import com.mframe.activiti.service.IAuditService;
import com.mframe.common.support.Convert;

/**
 * 审核 服务层实现
 * 
 * @author mframe
 * @date 2018-11-13
 */
@Service
public class AuditServiceImpl implements IAuditService {
	@Autowired
	private AuditMapper auditMapper;

	/**
	 * 查询审核信息
	 * 
	 * @param id
	 *            审核ID
	 * @return 审核信息
	 */
	@Override
	public Audit selectAuditById(Integer id) {
		return auditMapper.selectAuditById(id);
	}

	/**
	 * 查询审核列表
	 * 
	 * @param audit
	 *            审核信息
	 * @return 审核集合
	 */
	@Override
	public List<Audit> selectAuditList(Audit audit) {
		return auditMapper.selectAuditList(audit);
	}

	/**
	 * 新增审核
	 * 
	 * @param audit
	 *            审核信息
	 * @return 结果
	 */
	@Override
	public int insertAudit(Audit audit) {
		return auditMapper.insertAudit(audit);
	}

	/**
	 * 修改审核
	 * 
	 * @param audit
	 *            审核信息
	 * @return 结果
	 */
	@Override
	public int updateAudit(Audit audit) {
		return auditMapper.updateAudit(audit);
	}

	/**
	 * 删除审核对象
	 * 
	 * @param ids
	 *            需要删除的数据ID
	 * @return 结果
	 */
	@Override
	public int deleteAuditByIds(String ids) {
		return auditMapper.deleteAuditByIds(Convert.toStrArray(ids));
	}

	@Override
	public List<Audit> selectAuditListByPids(List<String> pids) {
		// TODO Auto-generated method stub
		return auditMapper.selectAuditListByPids(pids);
	}

}
